package com.jiyun.vo;

import lombok.Data;
import lombok.ToString;

/*
 * 作者：LiuHaoyang
 * 时间：2023/8/22 11:20
 * 描述：
 **/
@Data
@ToString
public class R<T> {

    private String code;
    private String message;
    private T data;

    public static R ok(Object data){
        R<Object> r = new R<>();
        r.setCode("SUCCESS");
        r.setMessage("成功");
        r.setData(data);
        return r;
    }

    public static R<Object> error(){
        R<Object> r = new R<>();
        r.setCode("ERROR");
        r.setMessage("失败");
        return r;
    }


}
